package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.vo.AdmiVigorousCollectionVO;
import com.sc.nft.entity.vo.UserVigorousCollectionVO;
import com.sc.nft.entity.vo.VigorousSecretAreaPageVO;
import com.sc.nft.enums.VigorousStatusEnum;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserVigorousCollectionRecords;
import com.sc.nft.mapper.UserVigorousCollectionRecordsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 质押任务-用户激活记录-关联藏品(sc_user_vigorous_collection_records)数据DAO
 *
 * @author kancy
 * @since 2023-06-13 14:55:25
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserVigorousCollectionRecordsDao extends ServiceImpl<UserVigorousCollectionRecordsMapper, UserVigorousCollectionRecords> {

    public List<AdmiVigorousCollectionVO> adminVigorousCollectionRecord(Long userVigorousRecordsId) {
        return baseMapper.adminVigorousCollectionRecord(userVigorousRecordsId);
    }

    public List<UserVigorousCollectionRecords> getListByUserVigorousRecordsId(Long userVigorousRecordsId, VigorousStatusEnum vigorousStatus) {
        LambdaQueryWrapper<UserVigorousCollectionRecords> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(UserVigorousCollectionRecords::getUserVigorousRecordsId, userVigorousRecordsId);
        wrapper.eq(UserVigorousCollectionRecords::getVigorousStatus, vigorousStatus);
        return list(wrapper);
    }

    public Page<VigorousSecretAreaPageVO> getPageVigorousSecretAreaRecordsByUserId(Page page, Long userId) {
        return baseMapper.getPageVigorousSecretAreaRecordsByUserId(page, userId);
    }

    public List<UserVigorousCollectionVO> getUserVigorousCollectionListByUserVigorousRecordsId(Long userVigorousRecordsId) {
        return baseMapper.getUserVigorousCollectionListByUserVigorousRecordsId(userVigorousRecordsId);
    }
}